<div class="full-screen">
    <div class="page-group">
        <div class="page page-current nocoupon_contentBOX">
            <div class="content">

                <div class="coupon_page_top">
                    <a href="javascript:history.back()"><{img class="coupon_top_return" src="images/icon04.png" app="wap"}></a>
                    <div class="coupon_top_text"><{if $addr_id}>编辑收货地址<{else}>添加收货地址<{/if}></div>
                </div>

                <div class="receiver_add">
                    <form action='<{link app=b2c ctl="wap_member" act="save_rec"}>' class="form" method="post" data-type="ajax">
                        <input type="hidden" name="addr_id" value="<{$addr_id}>">
                        <div class="arrival_inform_solid"></div>
                        <div class="arrival_inform_content">
                            <div class="arrival_inform_solid"></div>
                            <div class="arrival_inform_list">
                                <span class="arrival_inform_a" style="line-height: 3.3rem;">地区:</span>
                                <span class="receiver_inform_b">
                                    <{input app=ectools type="region" id="addr" platform="iswap" name='area' vtype=$area value=$area callback="selectArea" required="required"}>
                                </span>
                                <div class="clearfix"></div>
                            </div>

                            <div class="arrival_inform_solid"></div>
                            <div class="arrival_inform_list">
                                <span class="arrival_inform_a">收货地址:</span>
                                <span class="receiver_inform_b">
                                    <input type="hidden" class="text" name="addr_area" />
                                    <input type="text" class="receiver_input" name="addr" value="<{$addr}>" required="required" data-caution="收货地址不能为空" />
                                </span>
                                <div class="clearfix"></div>
                            </div>
                            <div class="arrival_inform_solid"></div>

                            <div class="arrival_inform_list">
                                <span class="arrival_inform_a">邮编:</span>
                                <span class="receiver_inform_b"><input type="text" class="receiver_input" name="zip" value="<{$zipcode}>"></span>
                                <div class="clearfix"></div>
                            </div>
                            <div class="arrival_inform_solid"></div>

                            <div class="arrival_inform_list">
                                <span class="arrival_inform_a">收货人姓名:</span>
                                <span class="receiver_inform_b"><input type="text" class="receiver_input"name="name" value="<{$name}>" required="required" data-caution="收货人姓名不能为空"></span>
                                <div class="clearfix"></div>
                            </div>
                            <div class="arrival_inform_solid"></div>

                            <div class="arrival_inform_list">
                                <span class="arrival_inform_a">手机:</span>
                                <span class="receiver_inform_b"><input type="text" class="receiver_input" name="mobile" value="<{$phone.mobile}>" vtype="mobile" data-caution="手机不能为空"></span>
                                <div class="clearfix"></div>
                            </div>
                            <div class="arrival_inform_solid"></div>

                            <div class="arrival_inform_list">
                                <span class="arrival_inform_a">固定电话:</span>
                                <span class="receiver_inform_b"><input type="text" class="receiver_input" name="tel" value="<{$phone.telephone}>" vtype="tel"></span>
                                <div class="clearfix"></div>
                            </div>

                            <div class="arrival_inform_solid"></div>
                            <div style="height: 0.5rem;"></div>
                            <div class="arrival_inform_list" style="line-height: 1.5rem;">
                                <input type="checkbox" name="def_addr" value="1" id="def_addr_check" style="margin-left:1rem;background:#d1bb7f; " <{if $default eq "1"}>checked=checked<{/if}>/>
                                <label for="def_addr_check" style="font-size:0.75rem;color:#d1bb7f;">设为默认收货地址</label>
                                <div class="clearfix"></div>
                            </div>
                            <div class="arrival_inform_list">
                                <button type="submit" class="button button-fill button-success popup_button_color "style="width: 90%;margin-left: 5%;line-height: 1.8rem;height: 1.8rem;" rel="_request">保存地址</button>
                                <div class="clearfix"></div>
                            </div>

                        </div>
                    </form>
                </div>


            </div>
        </div>
    </div>
</div>
<script>
    $(function(){
        selectArea = function(sels) {
            var selected = [];
            $.each(sels,function(){
                if($(this).css('display') != 'none'){
                    var text = this.selectedOptions[0].text;
                    if(['<{t}>北京<{/t}>','<{t}>天津<{/t}>','<{t}>上海<{/t}>','<{t}>重庆<{/t}>'].indexOf(text)>-1)return;
                    selected.push(text);
                }
            });
            var selectedV = selected.join('');
            if(!$('#addr').attr('value').match(selectedV)) $('#addr').attr('value',selectedV);
        };
        $('select').css({
            'display':'inherit',
            'width':'9rem',
            'background':'#d1bb7f'
        });
    })
</script>